from marshmallow import fields

from gis.common.django_ext.forms import EnumField
from itpay.core.agency.const import PayType, ComplaintType
from itpay.server_api.view.base import IMSignRequestSchema


class GetPayTypesSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)
    mch_id = fields.Integer(required=True)
    user_id = fields.String(required=True)


class MatchBestReceiptByPayTypeSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)
    mch_id = fields.Integer(required=True)
    user_id = fields.String(required=True)
    pay_type = EnumField(PayType, required=True)
    by_agency = fields.Integer()


class CreateOrderSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)
    mch_id = fields.Integer(required=True)
    user_id = fields.String(required=True)
    amount = fields.Integer(required=True)
    pay_type = EnumField(PayType, required=True)
    receipt_address_id = fields.Integer(required=True)


class GetPlayerInfoSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)
    mch_id = fields.Integer(required=True)
    user_id = fields.String(required=True)


class GetAgencyInfoSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)


class AgencyOffWorkSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)


class AgencyQuickReplySchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)


class AddBlacklistSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)
    mch_id = fields.Integer(required=True)
    user_id = fields.String(required=True)
    remark = fields.String(allow_none=True)


class CheckBlacklistSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)
    mch_id = fields.Integer(required=True)
    user_id = fields.String(required=True)


class CreateComplaintSchema(IMSignRequestSchema):
    agency_id = fields.Integer(required=True)
    mch_id = fields.Integer(required=True)
    user_id = fields.String(required=True)
    complaint_types = EnumField(ComplaintType, required=True)
    complaint_content = fields.String()
    images = fields.String()


